package paint;


import java.util.List;





    /**
     * Contains the vertices of an object.
     * @author Dustin Striplin
     *
     */
    public class WorldObject {
    	private static final int NUM_INTENSITIES = 255;
    	
    	public List<Vector4D> mPoints;
    	public int r; //red
    	public int g; //green
    	public int b; //blue
    	
    	/**
    	* In order for objects to be drawn correctly,
        * connecting points must be added in sequence. Colors are converted from world colors
        * to display colors.
        */
    	public WorldObject(double r, double g, double b, List<Vector4D> points) {
    		if(points.size() < 2) {
    			System.out.println("cannot have less than 2 points");
    			return;
    		}
    		this.r = (int)(r * (NUM_INTENSITIES-1));
    		this.g = (int)(g * (NUM_INTENSITIES-1));
    		this.b = (int)(b * (NUM_INTENSITIES-1));
    		mPoints = points;
    	}
    	
    	
    	@Override
    	public String toString() {
    		StringBuilder sb = new StringBuilder();
    		for(int i = 0; i < mPoints.size(); i++) {
    			sb.append(mPoints.get(i));
    			if(i < mPoints.size() - 1) {
    				sb.append(", ");
    			}
    		}
    		return sb.toString();
    	}
    }